//
//  UserJudgeTableViewCell.m
//  HDYS
//
//  Created by qianfeng on 15-4-22.
//  Copyright (c) 2015年 kay. All rights reserved.
//

#import "UserJudgeTableViewCell.h"

#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width

@implementation UserJudgeTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self createSubviews];
    }
    return self;
}

-(void)createSubviews{
    UIImageView *iconImgView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 40, 40)];
    iconImgView.image = [UIImage imageNamed:@"icon"];
    [self.contentView addSubview:iconImgView];
    
    UILabel *nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(iconImgView.frame.origin.x + iconImgView.frame.size.width + 5, iconImgView.frame.origin.y, 80, 17)];
    nameLabel.text = @"kay";
    nameLabel.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:nameLabel];
    
    UIImageView *starImgView = [[UIImageView alloc] initWithFrame:CGRectMake(nameLabel.frame.origin.x , nameLabel.frame.origin.y + nameLabel.frame.size.height + 3, 80, 20)];
    starImgView.image = [UIImage imageNamed:@"buyer-3-4@2x.png"];
    [self.contentView addSubview:starImgView];
    
    NSString *text = @"这件牛仔裤采用高档舒适的面料，款式新颖，更显档次，显瘦塑身，适合不同风格的美女，穿着季节长，百搭款，性价比高，绝对值得拥有。尺和厘米的转换：[1尺=33.33厘米，1厘米大概是0.03尺]";
    CGSize resize = [text sizeWithFont:[UIFont systemFontOfSize:12] constrainedToSize:CGSizeMake(SCREEN_WIDTH - 20, 10000) lineBreakMode:NSLineBreakByWordWrapping];
    
    UILabel *desLabel = [[UILabel alloc] initWithFrame:CGRectMake(iconImgView.frame.origin.x, iconImgView.frame.origin.y + iconImgView.frame.size.height + 5, SCREEN_WIDTH - 20, resize.height)];
    desLabel.font = [UIFont systemFontOfSize:13.0f];
    desLabel.text = text;
    desLabel.numberOfLines = 0;
    [self.contentView addSubview:desLabel];
}

@end
